<style>
    body {
        background-color: #ffffff;
    }

    .layui-iconpicker-body.layui-iconpicker-body-page .hide {
        display: none;
    }
</style>

<div class="layui-form layuimini-form">

    <div class="layui-form-item">
        <label class="layui-form-label required">配置名</label>
        <div class="layui-input-block">
            <input type="text" autocomplete="off" name="name" class="layui-input" lay-verify="required"
                   lay-reqtext="请输入配置名"
                   placeholder="请输入配置名" value="">
            <tip>填写配置名,不能与其他配置名还有系统配置文件配置名重复</tip>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label required">配置值类型</label>
        <div class="layui-input-block">
            <select name="type" lay-verify="required">
                <option value="">请选择配置值类型</option>
                <option value="0">字符串</option>
                <option value="1">数组</option>
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label required">配置值</label>
        <div class="layui-input-block">
            <textarea name="value" class="layui-textarea" placeholder="请输入配置值"></textarea>
            <tip>字符串类型直接写一行,一个数组写一行 ,二维数组用key value:号隔开, 代码示例如下,最终使用 config函数调用</tip>
            <pre class="layui-code">
数组配置示例
    1:已下单
    2:已支付
    3:已发货
            </pre>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">备注信息</label>
        <div class="layui-input-block">
            <input type="text" autocomplete="off" name="remark" class="layui-input"
                   placeholder="填写备注信息" value="">
            <tip>填写备注信息(非必填)</tip>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <select name="status" lay-filter="status">
                <option value="0">无效</option>
                <option value="1" selected="">有效</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;
        form.on('submit(saveBtn)', function (data) {
            var post_data = data.field;
            postData("{:url('config/add')}", post_data, '新增成功');
            return false;
        });
    });
</script>